<ui:composition
 xmlns="http://www.w3.org/1999/xhtml"
 xmlns:ui="http://java.sun.com/jsf/facelets"
 xmlns:f="http://java.sun.com/jsf/core"
 xmlns:h="http://java.sun.com/jsf/html"
 xmlns:rich="http://richfaces.org/rich"
 template="/template.xhtml">
 <ui:define name="center">
 <rich:dataTable  value="#{boutiqueBacking.order.items}" var="item" >
  <f:facet name="header">Panier</f:facet>
  <h:column>
  	<f:facet name="header">Titre</f:facet>
	<h:commandLink
	    action="#{boutiqueBacking.selectBook(item.book.id)}"
	    immediate="true" styleClass="panier">
	    <h:outputText value="#{item.book.title}" />
	</h:commandLink>
  </h:column>
  <h:column>
  	<f:facet name="header">Quantité</f:facet>
  	<f:facet name="footer">#{boutiqueBacking.order.articles}</f:facet>
  	<h:panelGrid columns="2" width="250px">
	    <h:outputText value="#{item.quantity}" />
	   <h:panelGrid column="1">
		   <h:commandLink action="#{boutiqueBacking.order.addOne(item.book)}">+</h:commandLink>
		   <h:commandLink action="#{boutiqueBacking.order.removeOne(item.book)}">-</h:commandLink>
	   </h:panelGrid>
	</h:panelGrid>
  </h:column>
  <h:column>
  	<f:facet name="header">Prix total</f:facet>
  	<f:facet name="footer">#{boutiqueBacking.order.total}</f:facet>
	   <h:commandLink
	    action="#{boutiqueBacking.selectBook(item.book.id)}"
	    immediate="true">
	    <h:outputText value="#{item.total}" />
	   </h:commandLink>
  </h:column>
 </rich:dataTable>
 </ui:define>
</ui:composition>
